package java_0530_map;

import org.w3c.dom.Node;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

@SuppressWarnings({"all"})
public class Map01 {
    public static void main(String[] args) {
        //使用entryMap的遍历方式
        Map map = new HashMap();
        map.put("1", "jack");
        map.put("1", "rose");

        Set entrySet = map.entrySet();

        for (Object obj : entrySet) {
            Map.Entry entry = (Map.Entry) obj;
            System.out.println(entry.getValue());
        }

        //集合的遍历方式
        Set set = new HashSet();
        set.add("jack");
        set.add("rose");

        for (Object obj :
                set) {
            System.out.println(obj);
        }
    }
}
